<template>
  <el-container>
    <el-header style="text-align: center; font-size: 30px">
      <span>千锋旅业后台管理系统</span>
    </el-header>
    <el-header style="text-align: right; font-size: 12px">
      <el-dropdown style="line-height: 20px">
        <i class="el-icon-setting" style="margin-right: 15px"></i>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item>个人中心</el-dropdown-item>
          <el-dropdown-item>个人设置</el-dropdown-item>
          <el-dropdown-item>退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      <span>{{ userName }}</span>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-col :span="24">
          <span>菜单</span>
          <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-setting"></i>
                <span>系统管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="1-1">
                  <router-link to="/userinfo">用户管理</router-link>
                </el-menu-item>
                <el-menu-item index="1-2">
                  <router-link to="/empinfo">员工管理</router-link>
                </el-menu-item>
                <el-menu-item index="1-3">
                  <router-link to="/role">角色管理</router-link>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="2">
              <template slot="title">
                <i class="el-icon-menu"></i>
                <span>业务管理</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="2-1">
                  <router-link to="/area">景区管理</router-link>
                </el-menu-item>
                <el-menu-item index="2-2">
                  <router-link to="/spot">景点管理</router-link>
                </el-menu-item>
                <el-menu-item index="3-3">
                  <router-link to="/order">订单管理</router-link>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
            <el-submenu index="3">
              <template slot="title">
                <i class="el-icon-menu"></i>
                <span>系统监控</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="3-1">
                  <router-link to="/log">系统日志</router-link>
                </el-menu-item>
                <el-menu-item index="3-2">
                  <router-link to="/echarts">系统报表</router-link>
                </el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-col>
      </el-aside>
      <el-main><router-view/></el-main>
    </el-container>

  </el-container>  
</template>

<script>
export default {
  data() {
    return {
      userName: this.$route.query.userName,
    };
  },

  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
};
</script>
<style scoped>
.el-header,
.el-footer {
  background-color: #519be8;
  color: #333;
  text-align: center;
  line-height: 90px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;

  line-height: 40px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
<i class="el-icon-menu"></i>